import Vue from 'vue';
import Vuex from 'vuex';

Vue.use(Vuex);

let City = '北京'

if(localStorage.City){
	City = localStorage.City;
}

const state = {
	city : City
}

const mutations = {
	cityChange(state,cityName){
		state.city = cityName;
		localStorage.City = cityName;
	}
}

export default new Vuex.Store({
	mutations,
	state
})